package com.gyf.crm.web.controller;

import com.gyf.crm.model.CourseOrder;
import com.gyf.crm.model.PageResult;
import com.gyf.crm.service.ICourseOrderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

@Controller
@RequestMapping("courseorder")
public class CourseOrderController {

    @Autowired
    ICourseOrderService orderService;

    @RequestMapping("list_json")
    @ResponseBody
    public PageResult<CourseOrder> list_json(@RequestParam(defaultValue =  "1",required = false) int page,
                                             @RequestParam(defaultValue = "2",required = false)int limit)
    {
        return orderService.findPageResult(null,page,limit);
    }


    @RequestMapping("list")
    public String list()
    {
        return "courseorder/list";
    }
}
